import request from '../utils/request'

// 获取默认地址接口
// /user/shipping-address/default/v2
// get
// token
export const getDefAddress=()=>{
  return request("/user/shipping-address/default/v2","get",{
    token:wx.getStorageSync("token")
  })
}
// 获取门店接口
export const getShopList=()=>{
  return request("/shop/subshop/list","post")
}

// 去结算接口
// 请求地址：/order/create
// POST
// 发送数据
// token: token
// goodsJsonStr: [{"goodsId":1704345,"number":6,"propertyChildIds":"undefined","logisticsType":0, "inviter_id":0}] //商品字符串
// remark:   //备注
// peisongType: kd //配送方式 kd 快递 zq 自取
// calculate: true
export const toCreate=(data)=>{
  return request("/order/create","post",data)
}
// 支付接口
export const wxPay=(data)=>{
  return request("/pay/wx/wxapp","post",data)
}
// 获取订单列表接口
// status " " 全部  0 待支付 1 代发货 2待收货 3 待评价
export const getOrderList=(status)=>{
  return request("/order/list","post",{
    token:wx.getStorageSync("token"),
      status: status
  })
}
// 关闭订单接口
export const closeOrder=(orderId)=>{
  return request("/order/close","post",{
    token:wx.getStorageSync("token"),
    orderId:orderId
  })
}